home *** CD-ROM | disk | FTP | other *** search
/ Acorn User: China / Acorn User China CD-ROM (UK) (Disc A) / Acorn User China CD-ROM (UK) (Disc A).bin / DEMON / WWW / WEBSTYLE.ARC / !WebStyle_!Help < prev    next >
Encoding:
Text File  |  1998-02-05  |  17.9 KB  |  427 lines

  1.                     _       __     __   _____ __        __   
  2.                    | |     / /__  / /_ / ___// /___  __/ /__ 
  3.                    | | /| / / _ \/ __ \\__ \/ __/ / / / / _ \
  4.                    | |/ |/ /  __/ /_/ /__/ / /_/ /_/ / /  __/
  5.                    |__/|__/\___/_.___/____/\__/\__, /_/\___/ 
  6.                                               /____/         
  7.  
  8.  
  9.  
  10. (c) Robin Moffatt (R.Moffatt@IName.com)         V1.29 (Thu 05th February 1998)
  11.  
  12.    See http://www.moffatt.demon.co.uk/me/webstyle.html for more information
  13.  
  14. Introducing WebStyle
  15. --------------------
  16. With all this talk about Stylesheets etc in the next version of HTML, I
  17. thought I'd write something which provided a cheap imitation of it, which
  18. would be available now, not whenever the HTML spec comes out plus a year for
  19. Acorn browsers to catch up......
  20.  
  21. You can use WebStyle (referred to as WS) as much or as little in your
  22. documents. You can have a simple header and footer for every page, or have
  23. many different tags on one page.
  24.  
  25. The big advantage of using Tags, rather than cutting and pasting a Header or
  26. Footer every time is that you can update a single source file, and leave
  27. WS to update the right parts of all your HTML pages. 
  28.  
  29. My practical use, and motivation, for writing WS, is a set of HTML
  30. pages, comprising the Horn Resources Pages (http://bounce.to/horn/).  These
  31. pages collect together over 190 separate topics from a mailing list, about
  32. horn playing. I used to have to use crude search&replace routines, or even
  33. do it by hand, when I wanted to change all the headers and footers on the
  34. pages, for example to update an email address. Now I just change the
  35. Stylefile and leave WS to do it all for me :)
  36.  
  37.  
  38. WS works on a system of Tags (embedded within HTML comments), and
  39. Styles. Each Style has its own file, within the directory
  40. <WebStyle$Dir>.styles The name of the file in the styles directory is the name
  41. of the Style.
  42.  
  43. As of version 0.20 of WS, you can mix Styles within a single HTML
  44. document. This means, for example, that you could have a generic footer for
  45. every single page on your site, but different headers depending on whether the
  46. page is in the, say, Weatherwax or Beeblebrox section of your site.
  47.  
  48. WS currently runs in 128k of memory. It's been written on and tested
  49. on a RPC600, and a can't see why it won't run on a SA, but then again that's
  50. not really much of an assurance :) It might work on RO2 - if you are still
  51. using it then mail me, just so I can have a good laugh. Seriously, I'd be
  52. interested to know if it does still work, and if it's a simple thing
  53. preventing it from working may even feel moved to fix it.
  54.  
  55. WS requires WimpExtension to run. ATM WS is only happy with
  56. WimpExt 2.18, which is why I've (as of WS1.14) decided to distribute it with
  57. WS. If anyone can point me towards documentation for WimpExt 3.45 then I'll
  58. set about making WS compatible with it.
  59.  
  60. At the moment WS is written in 100% pure, un-compacted, un-optimised
  61. BASIC. This is because I don't have a C compiler (boo-hoo. Not. Since I
  62. don't know any C either:), and I have better things to do with my time than
  63. arse around with ARM code. I'll have to be careful what I write here, after
  64. what happened with the frontend, but if anyone wants to convert main
  65. processing bits into something fast then they are more than welcome to. Mail
  66. me first to check it's not been done already :)
  67.  
  68.  
  69. Using WS
  70. --------------
  71. Before running WS, you have to do two things:
  72.  
  73. 1) Construct your style files. You can have just one, or you can have
  74.    twenty. It depends on how much versatility you require. Note that at the
  75.    moment the maximum number of tags that WS will handle is 50. If you
  76.    need more than this then alter the line maxstyle%=50 to whatever is
  77.    required. I plan to make this more easily configurable in the near future.
  78.    
  79.    Each Style should be in a separate file in the directory
  80.    <WebStyle$Dir>.styles - the filename gives the name of the Style.
  81.    
  82.    The syntax for Style files is the Tag name enclose by ASCII
  83.    character 235 (ë), then the HTML code to insert, starting on a newline,
  84.    then an ASCII character 233 (é) to mark the end of the HTML to insert.
  85.    
  86.    For example:
  87.    
  88.          ëTagNameë
  89.          <H1>This bit to insert</H1>
  90.          <EM>and this</EM>
  91.          <STRONG>and this as well</STRONG>
  92.          é
  93.  
  94.    In this case, you would have a Tag called TagName which when inserted in
  95.    the HTML would give
  96.    
  97.    <H1>This bit to insert</H1>
  98.    <EM>and this</EM>
  99.    <STRONG>and this as well</STRONG>
  100.    
  101.    The order that each separate Tag comes is not important. Please note that
  102.    Tag names /ARE/ case sensitive!
  103.    
  104.    Dynamic Variables
  105.    -----------------
  106.    There are currently four dynamic tags available. These are codes placed
  107.    in the Style file which are then processed at run-time. They are:
  108.    
  109.    ASC 232   è  Current Date
  110.    ASC 231   ç  URL of page
  111.    ASC 230   æ  Local filename of page (inc. path)
  112.    ASC 229   å  Filename of file being processed (exc. path)
  113.    
  114.    A suggested use for these is to place the following lines in the Stylefile (within a tag name, for example Footer)
  115.    
  116.    ëFooterë
  117.          <HR>
  118.          Last updated: è<BR>
  119.          URL: ç  <BR>
  120.          Local path: æ<BR>
  121.          Local filename: å
  122.    é      
  123.  
  124.     When processed by WS would give something like:
  125.          Last updated: Sat, 06 Dec 1997
  126.          URL: http://www.hostname.demon.co.uk/file.htm
  127.          Local path: ADFS::Harddisc4.$.Netpages.file/htm
  128.          Local filename: file/htm 
  129.       
  130.  
  131. 2) Insert your tags into the HTML files. This only needs to be done once,
  132.    since WS retains the Tags when processing the file, so you can
  133.    re-process the HTML files again and again, without having to insert the tags
  134.    each time.
  135.    
  136.    Say you want to insert the tag from the style file above. If we are
  137.    working from just one style file, then the Tag syntax would be:
  138.    
  139.    <!--WS=TagName-->
  140.    <!--endWS-->
  141.    
  142.    which when processed would give
  143.  
  144.    <!--WS=TagName-->
  145.    <H1>This bit to insert</H1>
  146.    <EM>and this</EM>
  147.    <STRONG>and this as well</STRONG>
  148.    <!--endWS-->
  149.  
  150.    However, if we want to specify from which Style to use the tag, the
  151.    syntax is:
  152.  
  153.    <!--WS=TagName{default}-->
  154.    <!--endWS-->
  155.    
  156.    This would then look for the Tag "TagName" in the Style "default"
  157.  
  158.    If there is a tag in an HTML file without a matching style entry, a note
  159.    will be put in the resulting HTML file, as well as an error being displayed
  160.    on screen. The program will still continue to run, meaning that one duff
  161.    entry won't stop the rest of the file being processed
  162.    
  163.    As of WS 1.20 you can have 'interactive' (thank god for Buzzwords;) tags.
  164.    This means that each document can have, say, a title added to it when it's
  165.    being processed.
  166.    
  167.    To do this, you use tags as detailed above, but use the ASCII character
  168.    236 (ì). For example
  169.    
  170.    <!--WS=ìPageTitle-->
  171.    <!--endWS-->
  172.    
  173.    would make WS prompt you for "PageTitle" when it gets to that tag.
  174.    As well as simply entering the text into the icon, you can have up to 20
  175.    predefined responses. These are defined in the file <WebStyle$Dir>.insert
  176.   
  177.    The format of this file is
  178.    
  179.    <menu label>,<text to insert>
  180.    
  181.    The <menu label> must be no longer than 12 character, otherwise it all
  182.    goes pear shaped. The text to insert, I think, can be up to 255
  183.    characters.
  184.    
  185.    Make sure that you end the file with a newline.
  186.  
  187.  
  188. The Configuration file
  189. ----------------------
  190. As of 1.18 there are now 4 configuration options. Two of these can be set
  191. from the main window, but for the moment you have to enter the other two
  192. manually. (The templates and code are actually in the application to allow
  193. one to enter the data without editting the file, but I'm buggered if I can
  194. get it to work....anyone is welcome to try :)
  195.  
  196. + To do this, open up the !WS directory (Hold down Shift and double
  197.   click on !WS)
  198. + Double-click on the directory "User"  
  199. + Double-click on the file "config"
  200. + After "Root directory on local disc for webpages = " enter the root
  201.   directory. For example, if all your pages are stored in directories
  202.   leading off from ADFS::HardDisc4.$.Internet.WebPages this would be your root
  203.   directory. I use raFS, so my root directory is raFS::WebSite.$ Note that you
  204.   _don't_ need a trailing dot, and if you do put one in WS will get upset. 
  205. + After "Root directory on remote server = " enter the root directory for
  206.   your remote server, where your web pages are kept. For demon users this will
  207.   probably be http://www.<nodename>.demon.co.uk/
  208. + Make sure there is always a space /after/ the = sign, on both lines,
  209.   otherwise, again, WS will get upset  
  210.  
  211. Running WS
  212. ----------------
  213. NB. It's advisable to unpack WS from the archive before running it
  214.  
  215. Double-click on !WS to run it. Clicking on the icon-bar WS icon
  216. will open the main window, from where you can choose how you wish to process
  217. the files. If you use automatic tagging (see above) or Clear tags, you just
  218. select the option, load your files (see below), and click on Start
  219. Processing. If you use a specific Style file you have to select one from the
  220. menu to the right of the icon. This will list all of the style files found
  221. in the directory <WebStyle$Dir>.styles
  222.  
  223. Note that when processing using a specific Style file, WS will insert
  224. this stylefile name into Automatic-tagging tags, so that next time you
  225. process the file you can just use Automatic tagging. If this proves
  226. unhelpful, let me know and I'll make it optional
  227.  
  228.  
  229. As of v1.00 of WS there are three ways of getting WS to process
  230. an HTML file. 
  231.  
  232. +  Any filelist text files that people used with earlier versions
  233.    are still valid. These are files with the _full_ filename of each HTML
  234.    file in, separated by a newline (ASC10 or ASC13). Make sure there is a
  235.    newline after the last file item. Drop this resulting text file onto the
  236.    WS icon and off you go :)
  237. +  Drop a single, or a batch, of HTML files onto the WS icon (or
  238.    window)
  239. +  Drop a directory or X-File onto the WS icon (or window). The
  240.    directory or X-File will be searched for all HTML files. WS won't
  241.    recursively search the directory/X-File, ie. it will only find HTML in the
  242.    first level of the directory/X-File
  243.  
  244. You can combine all three of these methods at once - the files are simply
  245. added onto the end of the queue.
  246.  
  247. WS will attempt to process every file you feed it - no problem if it's
  248. just an HTML file without any tags, since it'll just ignore it, but it will
  249. most likely barf if you give it JPEGs etc   
  250.  
  251.  
  252. Misc
  253. ----
  254. A log file is kept at <WebStyle$Dir>.error
  255. At the moment there is no way to disable it, but if it's needed let me know
  256. and I'll add the option. Actually, I tell a lie - you can set log% to FALSE
  257. in PROCInit, but this isn't advised, since PROCLog is used for more than
  258. writing to the log file, and may cause problems if it is disabled, tho' it
  259. shouldn't really
  260.  
  261. This program does what I envisaged, and only that. If you want it to do
  262. something, then ask me nicely, and I'll try to add it. Alternatively, if
  263. you're feeling brave, you could try and make sense of my programming, and do
  264. it yourself. If you do change something, let me have a copy!
  265.  
  266.  
  267. Legal bits
  268. ----------
  269. + You are advised to work solely from backups. WS /shouldn't/ chew up
  270.   your HTML files or feed them to the dog, but if it does, it ain't my fault!
  271.   By using this program you accept responsibility for all use of WS, and
  272.   any problems which may be inherent through that.
  273. + WS inserts a single line to indicate when the page was last
  274.   processed, as well as a little credit for the program. I would appreciate
  275.   if you'd leave the line in, seeing as I'm not charging for the program. If
  276.   it bothers you that much then donate 5 UKP to Imperial Cancer Research and
  277.   I'll send you a copy of the program with the credit etc removed. Of
  278.   course, you could do it yourself by hand (ooo-er;) but that's hardly a
  279.   nice thing to do is it?
  280. + This is <insert witty-ware name here>
  281. + I retain all copyright on the code etc, but feel free to copy it, hand it
  282.   around, feed it to your dog etc.
  283. + If you do nick bits of the code (though it really isn't worth it, believe
  284.   me:), I'd appreciate a credit for it
  285. + For PD distribution, please notify me first. The exception to this is
  286.   Skyfall PD, who are forbidden to distribute this program
  287. + For magazine distribution (I wish:) please contact me.
  288. + I would appreciate a quick email if you do use this, just to let me know
  289.   *someone* is using it!
  290.  
  291.  
  292. History
  293. -------
  294. 0.11 (29 Sep 97)    First release
  295. 0.20 (21 Oct 97)    Added multiple styles per document
  296.             Added process directory, doing away with the hassle
  297.                 of the 'files' file
  298.                Improved appearance of the 'front-end'
  299.                Altered log file, added 'Fatal' and 'Processing'
  300.              errors
  301. 1.00 (23 Oct 97)    Created multitasking frontend - no need for
  302.              Taskwindows any more             
  303.             Removed bug causing filelist files with ASC13 instead
  304.              of ASC10 as linefeeds to not work
  305. 1.05 (29 Oct 97)    Added selection of Styles from a menu             
  306.             Found and [hopefully] fixed loads of likkle bugs.
  307. 1.10 (31 Oct 97)    Corrected stupid error causing WS not to run
  308.              if it can't find WimpExt in the !WS directory
  309.             Corrected the WS URL that's added to every
  310.              HTML page that is processed 
  311.             Added Configuration file
  312.             Added Singletasking
  313. 1.14 (07 Nov 97)    Removed WS sprite to cut down archive size
  314.             Re-done Template file to correct error with large
  315.              desktop fonts obscuring option buttons
  316.             Added check for Style files that have been altered
  317.              while WS is running 
  318.             Added check for duplicate files
  319.             Added WimpExt 2.18 to distribution archive    
  320. 1.15 (12 Nov 97)    Added definable file limit 
  321.             Added 'Open style dir' button (Thanks to Phil Williams for these two)
  322.             Couple of logging alterations
  323.             Fixed problem with verifying the length of style
  324.              files when doing "Clear out tag contents"
  325. 1.15a (16 Nov 97)    Fixed directory handling bug    
  326. 1.15b (16 Nov 97)    Fixed fix for directory handling bug (!!)
  327. 1.16  (18 Nov 97)    Corrected iconbar menu height
  328. 1.20  (19 Nov 97)    Added Dynamic URL and Local filename insertion
  329.             Added tags allowing text to be entered during processing
  330.             Restructured the WS directory in anticipation of
  331.             future expansion
  332. 1.21  (20 Nov 97)    Fixed bug where <!--endWS--> would sometimes be duplicated            
  333. 1.25ß (03 Dec 97)    Added Dynamic Processing
  334. 1.26  (09 Dec 97)    Removed Dynamic Processing!
  335.             Added 'Open logfile' to Iconbar menu
  336. 1.27  (12 Jan 98)    Hopefully some kind of final release, for now anyway!    
  337. 1.28  (03 Feb 98)    Final release? Don't be daft! Tidied up templates etc
  338.         
  339.                          
  340. Future
  341. ------
  342. + WS gets really upset if you try and save files into it directly
  343.   from other programs, eg. an HTML file straight from an editor, or a text
  344.   filelist. It shouldn't be too hard (I hope:) to make it just ignore
  345.   these. Even better can someone tell be simply how to handle the files
  346.   myself?
  347. + WS Crashes if you add a style file and don't restart WS before trying to
  348.   process a file. Since it's a not very common thing to do, and doesn't
  349.   cause loss of data, I can't be bothered to fix it now :-)
  350. + Would be nice to be able to have the local and remote directories set
  351.   somewhere within the HTML file being processed, rather than being hardwired
  352.   into the configuration. This way files uploaded on seperate servers, or
  353.   running from different file systems can be processed without having to
  354.   re-configure WS each time.
  355. + Save to box for HTML file once processed
  356. + Window containing tags for auto-insertion into an editor window
  357. + Any other suggestions? Mail me! (See below for address)
  358.  
  359.  
  360. Bugs
  361. ----
  362. Any deviations from the progam's normal functions are simply an alternative
  363. way of doings things to what was envisaged by the author, and if you can't
  364. accept that then I really think you need to take a long look at your
  365. attitudes and acceptance of other views.
  366.  
  367. Seriously tho, I've not really found /proper/ bugs - doing daft stuff like
  368. running it without any input files is liable to upset it, but then again
  369. it's a rather dumb thing to do. Still, I'd like to know about any little
  370. discrepancies you find, since my aim is to create a program that is very
  371. easy, and very bug-free, to use :)
  372.              
  373.                  
  374. Thanks To
  375. ---------
  376. Me, for writing it ;-)
  377. Philip Powell, for suggesting a !WS.process directory plus masses of other
  378.                 general feedback and support.
  379. Stephen Read, for pointing out that WS was only recognizing LFs in the
  380.               'files' file instead of CRs, which StrongEd inserts.
  381. Dominic Symes, for Zap
  382. Tim Tyler, for Zap's HoTMeaL mode
  383. Jon Ribbers, for Wimp Extension
  384. Ferdinand Veldmans, for writing a frontend as I requested in the v0.11
  385.                     helpfile, only to find I'd decided to try and write one
  386.                     anyway. Sorry again for wasting your time :-)
  387.                     Also for sending me the calculation regarding the
  388.                     correct height for the iconbar menu.
  389. Phil Williams (aka RottenSod), for sending me the additional code to make the file limit
  390.                                definable, and for the 'open style dir' button bit                    
  391.  
  392.  
  393. Obtaining the latest version of WS
  394. ----------------------------------------
  395. http://www.moffatt.demon.co.uk/me/webstyle.html
  396. Or various FTP sites included HENSA, Demon and Argonet, when I get round to
  397. uploading it there.
  398.  
  399. Contacting me
  400. -------------
  401. Email: Take your pick <g> (all should work, but are given in order of
  402. preference, top to bottom)
  403.  
  404. R.Moffatt@IName.com
  405. Robin@moffatt.demon.co.uk
  406.  
  407. WWW:
  408. http://bounce.to/Robin/
  409. http://www.moffatt.demon.co.uk/
  410.  
  411.  
  412. -- 
  413. |D     |\/|       ** http://bounce.to/Robin/ ** Sheffield, UK **
  414. |\obin |  |offatt **   R.Moffatt@IName.com   ** Horn Player   **
  415.  
  416. "...except a few pieces most of this more or less organised noise
  417. sounds to me like the noise someone's body might produce after
  418. eating cherries & cucumbers & drinking a lot of water afterwards.
  419. What the body produces after this 'special  diet' (you could
  420. replace water with 'new wine') by shock and releases by shock, 
  421. just this sounds & smells like a lot of the products by these
  422. chaotic self established composers."
  423.  
  424.                          - Prof Hans Pizka on much of Modern music
  425.  
  426.          Horn Resources Pages - http://bounce.to/horn/
  427.